package DesignPatern.A06_代理模式.QXB.A02基础模式;

/**
 * @Author: Du
 * @Date: 2021/7/22 10:04
 */
public class Proxy implements Subject
{
    private Subject subject = null;
    
    public Proxy(Subject subject)
    {
        this.subject = subject;
    }
    
    /**
     * 包装了处理方法
     */
    @Override
    public void request()
    {
        this.before();
        this.subject.request();
        this.after();
    }
    
    public void before()
    {
        System.out.println("处理前");
    }
    
    public void after()
    {
        System.out.println("处理后");
    }
}
